package cn.zhentao;

import io.minio.MinioClient;
import io.minio.ObjectWriteResponse;
import io.minio.PutObjectArgs;
import io.minio.PutObjectBaseArgs;
import lombok.SneakyThrows;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Repeat;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@SpringBootTest
public class MinioText {
    @Test
    public void minioUp(){
       MinioClient minioClient = MinioClient.builder()
               .credentials()
               .endpoint()
               .build();
       FileInputStream fileInputStream = new FileInputStream();
       PutObjectArgs putObjectArgs = PutObjectArgs.builder()
               .bucket()
               .object()
               .stream(fileInputStream, fileInputStream.available(), -1)
               .contentType()
               .build();
       ObjectWriteResponse response = minioClient.putObject(putObjectArgs);
       String url = minioClient.getObjectUrl(putObjectArgs.bucket(), ,putObjectArgs.object());
    }
}
